trivial-httpd: Close stdout & stdin so $() can capture output when daemonized
authorVivek Dasmohapatra <vivek@collabora.co.uk>
Thu, 22 Aug 2013 18:43:44 +0000 (19:43 +0100)
committerColin Walters <walters@verbum.org>
Fri, 23 Aug 2013 16:28:37 +0000 (12:28 -0400)
Will be used by tests.

src/ostree/ot-builtin-trivial-httpd.c

index 178f20c5f35be18d166789d06b4a23fbb156b389..3c8fff9b01760d22db322320767dcb5cf6656799 100644 (file)
@@ -334,6 +334,9 @@ ostree_builtin_trivial_httpd (int argc, char **argv, GFile *repo_path, GCancella
           _exit (0);
         }
       /* Child, continue */
+      /* Daemonising: close stdout/stderr so $() et al work on us */
+      fclose (stdout);
+      fclose (stdin);
     }
 
   app->running = TRUE;